home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 6⁄1⁄90 / 1384-Re TEditText Problem-May90 < prev    next >
Encoding:
Text File  |  1990-06-01  |  2.0 KB  |  62 lines  |  [TEXT/GEOL]

  1. Item    3589703                         30-May-90        18:23PDT
  2.  
  3. From:   D2234                           Cock, Calvin,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    Re- TEditText Problem
  8.  
  9. Ken,
  10.  
  11.     I ran into your exact problem.  The reason is that the floating
  12. TDialogTTEView that is magically put over your TEditText and TNumberText fields
  13. DOES NOT INCLUDE YOUR VIEW IN THE DoKeyCommand CHAIN ANYMORE.  What you have to
  14. do is add the following method to each of the views that you wish to filter
  15. keystrokes for.
  16.  
  17. PROCEDURE TYourEditText.KeyEventToComponents(VAR info: EventInfo); OVERRIDE;
  18.  
  19.  
  20.     If you do not want any characters to appear in your TextEdit fields the
  21. following should work.  ( no guarantees! )
  22.  
  23. PROCEDURE TYourEditText.KeyEventToComponents(VAR info: EventInfo); OVERRIDE;
  24.  
  25.  
  26.    BEGIN
  27.       IF (fTEView <> NIL) THEN
  28.          BEGIN
  29.             WITH info, thePEvent^ DO
  30.                BEGIN
  31.                   IF (what = keyDown) | (what = autoKey) THEN
  32.                      BEGIN
  33.                         { Default extractions }
  34.                         theCharacter := chr(BAND(message, charCodeMask));
  35.                         theKeycode := BSR(BAND(message, keyCodeMask), 8);
  36.  
  37.                         { Save the character typed here if you wish }
  38.  
  39.                         { Clear out all traces of the key pressed }
  40.                         theCharacter := chr ( 00 );
  41.                         theKeyCode   := 0;
  42.                         message := 0;
  43.                      END;
  44.                END;
  45.             IF fNextHandler <> NIL THEN
  46.                fNextHandler.KeyEventToComponents(info)
  47.          END;
  48.    END;
  49.  
  50.     Although you are programming in C++ (My condolences) I think you can get
  51. the gist of the matter from the above.  I don't even know how to spell Cee.
  52.  
  53.     I was real miffed when I found out my view was not in the DoKeyCommand
  54. chain anymore.  I think that the view should have a chance at handling the keys
  55. without having to resort to fiddling with the event records.
  56.  
  57. Good Luck
  58.  
  59. Calvin (AKA "Earnie") Cock
  60.  
  61.  
  62.